<?php
/*
 *author:Yangligao
 *Date:2013-9-28
 */
require '../../Config.php';
$flag = $_GET['flag'];
$flinkModel = new FlinkModel();
if($flag == 'display'){
	$res = $flinkModel->flink_select();
	$pageSize = 8;
	$totalCount = count($res);
	$pageModel = new Page($pageSize, $totalCount);
	
	$start = $pageModel->getStart();
	$res_ = $flinkModel->flink_select("*",'',"limit {$start},{$pageSize}");
	$pageStr = $pageModel->getPageStr();
	$smarty->assign('pageStr',$pageStr);
	$smarty->assign('linkData',$res_);
	$smarty->display('Admin/FlinkM/flinkm.html');
}else if($flag == 'flinkdelete'){
	
	$arr['flink_id'] = $_GET['id'];
	

	
	$res = $flinkModel->flink_delete($arr);
	
	if($res){
		jump('操作成功！', $_SERVER['HTTP_REFERER']);
	}else{
		alertInfo('操作失败！', $_SERVER['HTTP_REFERER']);
	}
}else if($flag == 'delMore'){
	
	if(isset($_POST['each'])){
		$keyArr = $_POST['each'];
	
	}else{
		$keyArr="";
	}
	$res = $flinkModel->flink_deleteMoreByKey($keyArr);
	if($res){
		jump("记录删除成功", $_SERVER['HTTP_REFERER']);
	}else{
		jump("记录删除失败", $_SERVER['HTTP_REFERER']);
	}
}

?>
